<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s"  uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=cn-gb">
		<link href="css/style.css" rel="stylesheet" type="text/css">
		  <s:head theme="xhtml"/>
  		  <sx:head parseContent="true"/>

		<title>添加 商品</title>

		<script type="text/javascript">
			function goodAction() {
				var d = document.forms[0];
				d.action = "addNewGood";
				d.submit();
			}
		</script>
		<style type="text/css">
		.errorMessage {
			font-size: 12px;
			color: red;
		}
		</style>
	</head>

	<body>
		<center>
			<h2>
				添加 商品
			</h2>
		</center>
		<center>
			<font color="red"> ${requestScope.addGoodName}</font>
			<s:form method="post">
				<table>
					<tr>
						<td>
							<s:textfield label="商品编号" name="good.goodId" size="14" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="商品名称" name="good.goodName" size="20" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="商品简称" name="good.goodSimpName" size="10" />
						</td>
					</tr>
					<tr>
						<td>
							<s:select id="GuiGeList" name="good.specification" label="规格"
								  list="%{#request.allSpecification}"
								  listKey="id" listValue="goodSimpName" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="包装" name="good.package" size="10" />
						</td>
					</tr>
					<tr>
						<td>
							<s:select id="OriginalList" name="good.original" label="产地"
								  list="%{#request.allOriginal}"
								  listKey="id" listValue="original" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="进价" name="good.priceIn" size="10" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="售价" name="good.priceSell" size="10" />
						</td>
					</tr>
					<tr>
						<td>
							<s:select id="GoodCategoryList" name="good.goodCategory" label="商品分类"
								  list="%{#request.allGoodCategory}"
								  listKey="id" listValue="goodCategory" />
						</td>
					</tr>
					<tr>
						<td>
							<sx:datetimepicker label="入库日期" name="good.buyDate" value="%{date}"
							   displayFormat="yyyy-MM-dd" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="品牌" name="good.brand" size="10" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="条码" name="good.barCode" size="10" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="备注" name="good.memo" size="100" />
						</td>
					</tr>
					<tr align="center">
						<td colspan="2">
							<input type="button" value="保存" name="Save" onclick="goodAction();" />
							<input type="reset"  value="重置" name="Reset" />
							<input type="button" value="返回" name="Back" onclick="history.go(-1);" />
						</td>
					</tr>
				</table>
			</s:form>
		</center>
	</body>
</html>